@extends('home.public.base')

@section('title', '订单列表')

@section('content')
    <style>
        .lh1 span, .down span {
            display: inline-block;
            margin: 0 5%;
        }

        .lh1 a {
            border: 1px solid #666666;
            padding: 3px;

        }

        .down span, .down a {
            display: inline-block;
            margin-top: 25px;
        }

        .down span {
            width: 20%
        }

        .down span:nth-of-type(1) {
            margin-top: 0
        }

        .orderchange {
            display: inline-block;
            margin-left: 2em;
            margin-top: -.5em;
        }
    </style>
    <div class="md-account clear bg-f5f5f5">
        <div class="center">
            <div class="    bg-fff">
                <div class="user-title f30 f-666">我的订单</div>
                <div class="user-content">

                    <ul class="order-list">
                        @foreach($orderlists as $orderlist)
                            <li class="m-b-20 b-1" style="padding: 10px;">
                                <div class="top p-y-30 clear b-b-1 lh1">
                                    <span class="fl">订单号：{{$orderlist['no']}}</span>
                                    <span class="f-666 fl">{{$orderlist['created_at']}}</span>
                                    <span class="f-999 fl">总额：<em
                                                class="f-d93732">￥{{$orderlist['allprice']}}</em></span>
                                    <span class="f-cdae7d fl tc">
                                        {{--订单状态1新订单 2付款 3发货 4完成 5退货--}}
                                        @switch($orderlist['orderstatus'])
                                            @case(1)
                                            新订单 ， 等待付款
                                            <a href="/ordersuccess/{{$orderlist['id']}}"
                                               class="orderchange detail-btn fr dib tc">去付款</a>
                                            @break

                                            @case(2)
                                            已付款，等待发货
                                            @break

                                            @case(3)
                                            已发货，等待签收
                                            <a href="/changeorder/{{$orderlist['id']}}/4"
                                               onclick="return confirm('确认签收？')"
                                               class="orderchange detail-btn fr dib tc">签收</a>
                                            @break

                                            @case(4)
                                            订单完成
                                            <a href="/changeorder/{{$orderlist['id']}}/5"
                                               onclick="return confirm('确认退货？')"
                                               class="orderchange detail-btn fr dib tc">退货，发出快递</a>
                                            @break

                                            @case(5)
                                            发起退货中，等待卖家签收。
                                            @break

                                            @case(6)
                                            退货完成
                                            @break
                                        @endswitch
                                    </span>

                                </div>
                                <div class="down">
                                    @foreach($orderlist->getorderlist as $orderdetails)
                                        <p class="line clear rel">
                                            <span class="fl m-r-10">
                                                <img style="width: 60px; height: 60px; margin: 5px; border: 1px solid #999988"
                                                     src="{{$orderdetails['img']}}">
                                            </span>
                                            <span class="fl goods-name overtxt m-r-10">{{$orderdetails['title']}}</span>
                                            <span class="fl">¥{{$orderdetails['price']}} X {{$orderdetails['num']}}</span>
                                        </p>
                                    @endforeach

                                </div>
                            </li>

                        @endforeach


                    </ul>

                    <style>
                        .page {
                            text-align: center;
                            padding: 10px;
                        }

                        .page ul li {
                            float: left;
                            padding: 5px 10px;
                            color: dodgerblue;
                            border: 1px dodgerblue solid;
                            border-radius: 5px;
                            margin-left: 5px;
                        }

                        .page ul li a {
                            padding: 5px;
                        }
                    </style>
                    <div class="page">
                        {{ $orderlists->links() }}<br>
                    </div>

                </div>
            </div>
        </div>
    </div>



@endsection